﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ProductIntroduction.Models;

namespace ProductIntroduction.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            DBEntities eModel = new DBEntities();

            Config objConfig = eModel.Configs.FirstOrDefault(s => s.Selected);
            string websiteTitle = string.Empty;
            string websiteName = string.Empty;
            string websiteSlogan = string.Empty;
            string footer = string.Empty;

            if (objConfig != null)
            {
                websiteTitle = objConfig.WebsiteTitle;
                websiteName = objConfig.WebsiteName;
                websiteSlogan = objConfig.WebsiteSlogan;
                footer = objConfig.Footer;
            }

            ViewBag.Title = websiteTitle;
            ViewBag.WebsiteName = websiteName;
            ViewBag.WebsiteSlogan = websiteSlogan;
            ViewBag.Footer = footer;

            return View();
        }

        public ActionResult About()
        {
            return View();
        }
    }
}
